package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TaskInfo;
import com.atguigu.userprofile.util.MySqlUtil;

public class TaskInfoDao {

    public static void main(String[] args) {
        TaskInfo taskInfo = selectTaskInfoById("1");
        System.out.println(taskInfo);
    }

    public static TaskInfo selectTaskInfoById(String taskId ){
        String sql = "SELECT \n" +
                " id , task_name , task_status , task_comment , task_time , task_type , exec_type , main_class , file_id , task_args , task_sql , task_exec_level , create_time \n" +
                "FROM \n" +
                " task_info \n" +
                "WHERE id = " + taskId;
        TaskInfo taskInfo = MySqlUtil.selectOne(sql, TaskInfo.class, true);
        return taskInfo ;
    }
}
